package cn.crm.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * AddressBook entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "AB_ADDRESSBOOK")
public class AddressBook implements java.io.Serializable {

	// Fields

	private String abProid;
	private Customer customer;
	private DDL DDLByTypeDepartments;
	private DDL DDLByTypeDutiesname;
	private User user;
	private DDL DDLByTypeSex;
	private String abTellphone;
	private Integer abZipcode;
	private String abEmail;
	private String abQq;
	private String abProname;
	private String abInterest;
	private Date abBirth;
	private String abAddress;
	private Boolean abIsdelete;
	private Set<Appointement> appointements = new HashSet<Appointement>(0);

	// Constructors

	/** default constructor */
	public AddressBook() {
	}

	/** minimal constructor */
	public AddressBook(String abProid) {
		this.abProid = abProid;
	}

	/** full constructor */
	public AddressBook(String abProid, Customer customer,
			DDL DDLByTypeDepartments, DDL DDLByTypeDutiesname, User user,
			DDL DDLByTypeSex, String abTellphone, Integer abZipcode,
			String abEmail, String abQq, String abProname, String abInterest,
			Date abBirth, String abAddress, Boolean abIsdelete,
			Set<Appointement> appointements) {
		this.abProid = abProid;
		this.customer = customer;
		this.DDLByTypeDepartments = DDLByTypeDepartments;
		this.DDLByTypeDutiesname = DDLByTypeDutiesname;
		this.user = user;
		this.DDLByTypeSex = DDLByTypeSex;
		this.abTellphone = abTellphone;
		this.abZipcode = abZipcode;
		this.abEmail = abEmail;
		this.abQq = abQq;
		this.abProname = abProname;
		this.abInterest = abInterest;
		this.abBirth = abBirth;
		this.abAddress = abAddress;
		this.abIsdelete = abIsdelete;
		this.appointements = appointements;
	}

	// Property accessors
	@Id
	@Column(name = "AB_PROID", unique = true, nullable = false, length = 16)
	public String getAbProid() {
		return this.abProid;
	}

	public void setAbProid(String abProid) {
		this.abProid = abProid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CINFO_CUSTID")
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE_DEPARTMENTS")
	public DDL getDDLByTypeDepartments() {
		return this.DDLByTypeDepartments;
	}

	public void setDDLByTypeDepartments(DDL DDLByTypeDepartments) {
		this.DDLByTypeDepartments = DDLByTypeDepartments;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE_DUTIESNAME")
	public DDL getDDLByTypeDutiesname() {
		return this.DDLByTypeDutiesname;
	}

	public void setDDLByTypeDutiesname(DDL DDLByTypeDutiesname) {
		this.DDLByTypeDutiesname = DDLByTypeDutiesname;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "us_createUser")
	public User getUser() {
		return this.user;
	}
	

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE_SEX")
	public DDL getDDLByTypeSex() {
		return this.DDLByTypeSex;
	}

	public void setDDLByTypeSex(DDL DDLByTypeSex) {
		this.DDLByTypeSex = DDLByTypeSex;
	}

	@Column(name = "AB_TELLPHONE", length = 13)
	public String getAbTellphone() {
		return this.abTellphone;
	}

	public void setAbTellphone(String abTellphone) {
		this.abTellphone = abTellphone;
	}

	@Column(name = "AB_ZIPCODE", precision = 6, scale = 0)
	public Integer getAbZipcode() {
		return this.abZipcode;
	}

	public void setAbZipcode(Integer abZipcode) {
		this.abZipcode = abZipcode;
	}

	@Column(name = "AB_EMAIL", length = 50)
	public String getAbEmail() {
		return this.abEmail;
	}

	public void setAbEmail(String abEmail) {
		this.abEmail = abEmail;
	}

	@Column(name = "AB_QQ", length = 20)
	public String getAbQq() {
		return this.abQq;
	}

	public void setAbQq(String abQq) {
		this.abQq = abQq;
	}

	@Column(name = "AB_PRONAME", length = 12)
	public String getAbProname() {
		return this.abProname;
	}

	public void setAbProname(String abProname) {
		this.abProname = abProname;
	}

	@Column(name = "AB_INTEREST", length = 60)
	public String getAbInterest() {
		return this.abInterest;
	}

	public void setAbInterest(String abInterest) {
		this.abInterest = abInterest;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "AB_BIRTH", length = 7)
	public Date getAbBirth() {
		return this.abBirth;
	}

	public void setAbBirth(Date abBirth) {
		this.abBirth = abBirth;
	}

	@Column(name = "AB_ADDRESS", length = 35)
	public String getAbAddress() {
		return this.abAddress;
	}

	public void setAbAddress(String abAddress) {
		this.abAddress = abAddress;
	}

	@Column(name = "AB_ISDELETE", precision = 1, scale = 0)
	public Boolean getAbIsdelete() {
		return this.abIsdelete;
	}

	public void setAbIsdelete(Boolean abIsdelete) {
		this.abIsdelete = abIsdelete;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "addressBook")
	public Set<Appointement> getAppointements() {
		return this.appointements;
	}

	public void setAppointements(Set<Appointement> appointements) {
		this.appointements = appointements;
	}

}